import { Body, Controller, Inject, Post } from "@midwayjs/core";
import { RespInfo } from "../types/common.type";
import { ThumbService } from "../service/thumb.service";
import { ThumbType } from "../types/thumb.type";


@Controller('/thumb')
export class NoteController {

  @Inject()
  thumbService: ThumbService;


  @Post('/updated')
  async setThumb(@Body() info: { user: string, target: string, type: ThumbType }): Promise<RespInfo> {
    const { user, target, type } = info;
    return await this.thumbService.setThumb(user, target, type)
  }

}